<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<form method="post" action="{{url('Admin/config')}}" style="padding-left: 20px;border: 1px">
    {{csrf_field()}}
    <div style="background-color: #2ca02c">
        @if(count($errors)>0)
            @if(is_object($errors))
                @foreach($errors->all() as $error)
                    <p>{{$error }}</p>
                @endforeach
            @else
                {{$errors}}
            @endif

        @endif
    </div>
    <table style="">
        <tr>
            <th> <i class="required">*</i> 标题</th>
            <td><input type="text" name="conf_title"/><i>!</i>配置项标题必须填写<br/></td>
        </tr>
        <tr>
            <th>
                <i>*</i>名称:
            </th>
            <td> <input type="text" name="conf_name"/><i>!</i>配置项名称必须填写</td>
        </tr>
        <tr>
            <th>
               类型：
            </th>

            <td>
                <input type="radio" name="field_type" value="input" onclick="showtr()" checked/>input
                <input type="radio" name="field_type" value="textarea" onclick="showtr()"/>textarea
                <input type="radio" name="field_type" value="radio" onclick="showtr()"/>radio


                <i style="padding-right: 20px;background-color: red; padding-left: 10px;width: 10px">!</i>类型:input textarea radio<br/></td>
        </tr>
        <tr class="field_value">
            <th >
                类型值
            </th>
            <td><input type="text" name="field_value"/></td>
        </tr>
        <tr>
            <th>排序</th>
            <td><input type="text " value="0" name="conf_order"></td>

        </tr>
        <tr>
            <th>说明</th>
            <td><textarea name="conf_tips"></textarea></td>

        </tr>
        <tr>
            <td>
                <input type="submit" value="确定添加"/>
                <input type="reset" value="返回"/>

            </td>
        </tr>

    </table>

</form>

<script type="text/javascript" src="{{asset('resources/views/Admin/js/jquery-3.1.1.min.js')}}"></script>
<script>
    showtr();
   function showtr() {
       $type=$('input[name=field_type]:checked').val();
       if ($type=='radio'){
           $('.field_value').show();
       }else {
           $('.field_value').hide();
       }
   }

</script>
</body>
</html>